home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / diskBoot.OpenProm / RCS / fsDisk.c,BAD < prev    next >
Encoding:
Text File  |  1990-11-27  |  34.3 KB  |  1,245 lines

  1. 10
  2. # or something immediately after the boot program prints out the kernel sizes.)
  3. # BOOTDIR is the directory in which the boot things live.
  4. #
  5.  
  6. #if !empty(TM:Msun3)
  7. KERNELSTART    ?= 0x3fe0
  8. LINKSTART    ?= d4000
  9. #else
  10. #if !empty(TM:Msun4)
  11. KERNELSTART    ?= 0x4000
  12. LINKSTART    ?= $(KERNELSTART:S/0x/20/)
  13. #else
  14. #if !empty(TM:Mds3100)
  15. KERNELSTART    ?= 0x80010000
  16. LINKSTART    ?= $(KERNELSTART:S/0x//)
  17. #else
  18. #if !empty(TM:Msun4c)
  19. KERNELSTART    ?= 0x3fe0
  20. LINKSTART    ?= $(KERNELSTART:S/0x/20/)
  21. #else
  22. KERNELSTART    ?= 0x4000
  23. LINKSTART    ?= $(KERNELSTART:S/0x/b/)
  24. #endif
  25. #endif
  26. #endif
  27. #endif
  28.  
  29. CFLAGS        += -DBOOT_CODE=0x$(LINKSTART) \
  30.         -DKERNEL_START=$(KERNELSTART) -DBOOTDIR=\"$(INSTALLDIR)\" \
  31.         -DBOOT_FILE=\"$(TM)\"
  32.  
  33.  
  34. #
  35. # The .INCLUDES variable already includes directories that should be
  36. # used by cc and other programs by default.  Remove them, just so that
  37. # the output looks cleaner.
  38.  
  39. CFLAGS        += $(.INCLUDES:S|^-I/sprite/lib/include$||g:S|^-I/sprite/lib/include/$(TM).md$||g)
  40.  
  41. #
  42. # Transformation rules: these have special features to place .o files
  43. # in md subdirectories, run preprocessor over .s files, etc.
  44. # There are no profile rules for boot programs because they aren't profiled.
  45. #
  46.  
  47. .c.o        :
  48.     $(RM) -f $(.TARGET)
  49.     $(CC) $(CFLAGS) -c $(.IMPSRC) -o $(.TARGET)
  50. .s.o    :
  51. #if empty(TM:Mds3100)
  52.     $(CPP) $(CFLAGS:M-[ID]*) -m$(TM) -D$(TM) -D_ASM $(.IMPSRC) > $(.PREFIX).pp
  53.     $(AS) -o $(.TARGET) $(AFLAGS) $(.PREFIX).pp
  54.     $(RM) -f $(.PREFIX).pp
  55. #else
  56.     $(RM) -f $(.TARGET)
  57.     $(AS) $(AFLAGS) $(.IMPSRC) -o $(.TARGET)
  58. #endif
  59.  
  60. #
  61. # The following targets are .USE rules for creating things.
  62. #
  63.  
  64. #
  65. # MAKEBOOT usage:
  66. #    <program> : <objects> <libraries> MAKEBOOT
  67. #
  68. # Similar to MAKECMD, except it doesn't create the version.[ho] files,
  69. # and the variable LINKSTART is used to define where the boot program
  70. # gets loaded.
  71. #
  72. MAKEBOOT    :  .USE -lc
  73.     rm -f $(.TARGET)
  74.     $(LD) -N -e start -T $(LINKSTART) $(CFLAGS:M-L*) $(LDFLAGS) \
  75.         -o $(.TARGET) $(.ALLSRC:N-lc:Nend.o) -lc $(.ALLSRC:Mend.o)
  76.  
  77. #
  78. # MAKEINSTALL usage:
  79. #    install :: <dependencies> MAKEINSTALL
  80. #
  81. # The program is installed in $(TMINSTALLDIR) and backed-up to
  82. # $(TMINSTALLDIR).old
  83. #
  84. #ifndef NOBACKUP
  85. BACKUP        = -b $(TMINSTALLDIR).old
  86. #ifdef BACKUPAGE
  87. BACKUP += -B $(BACKUPAGE)
  88. #endif
  89. #else
  90. BACKUP        =
  91. #endif  NOBACKUP
  92.  
  93. MAKEINSTALL    : .USE
  94.     ${RM} -f $(TMINSTALLDIR)/$(NAME)
  95.     ${INSTALL_PROG} $(TM).md/$(NAME) $(TMINSTALLDIR)/$(NAME)
  96.  
  97. #
  98. # MAKELINT usage:
  99. #    <fluff-file> : <sources to be linted> MAKELINT
  100. #
  101. # <fluff-file> is the place to store the output from the lint.
  102. #
  103. MAKELINT    : .USE
  104.     $(RM) -f $(.TARGET)
  105.     $(LINT) $(LINTFLAGS) $(CFLAGS:M-[ID]*) $(.ALLSRC) > $(.TARGET) 2>&1
  106.  
  107. #
  108. # MAKEDEPEND usage:
  109. #    <dependency-file> : <sources> MAKEDEPEND
  110. #
  111. # Generate dependency file suitable for inclusion in future makes.
  112.  
  113. MAKEDEPEND    : .USE
  114.     @$(TOUCH) $(DEPFILE)
  115.     $(MAKEDEPEND) $(CFLAGS:M-[ID]*) -m $(TM) -w60 -f $(DEPFILE) $(.ALLSRC)
  116.     @$(MV) -f $(DEPFILE) $(DEPFILE).tmp
  117.     @$(SED) -e '/^#/!s|^.|$(TM).md/&|' <$(DEPFILE).tmp > $(DEPFILE)
  118.     @$(RM) -f $(DEPFILE).tmp
  119.  
  120. #if !defined(no_targets) && defined(NAME)
  121. #
  122. # We should define the main targets (make, make install, etc.).  See the
  123. # mkmf man page for details on what these do.
  124. #
  125. LIBS            ?=
  126.  
  127. #
  128. # start.o must come first
  129. default            : $(TM).md/$(NAME)
  130. $(TM).md/$(NAME)    : $(TM).md/start.o $(OBJS:S/$(TM).md\/start.o//:S/makeBoot.o//) MAKEBOOT
  131.  
  132.  
  133. clean            :: .NOEXPORT tidy 
  134.     $(RM) -f $(TM).md/$(NAME) 
  135.  
  136. tidy            :: .NOEXPORT 
  137.     $(RM) -f $(CLEANOBJS) $(CLEANOBJS:M*.o:S/.o$/.po/g) \
  138.             y.tab.c lex.yy.c core \
  139.         $(TM).md/lint \
  140.         a.out *~ $(TM).md/*~ version.h gmon.out mon.out
  141.  
  142. DEPFILE = $(TM).md/dependencies.mk
  143.  
  144. depend            : $(DEPFILE)
  145. $(DEPFILE)        ! $(SRCS:M*.c) $(SRCS:M*.s) MAKEDEPEND
  146.  
  147.  
  148. #
  149. # For "install", a couple of tricks.  First, allow local.mk to disable
  150. # by setting no_install.  Second, use :: instead of : so that local.mk
  151. # can augment install with additional stuff.  Third, don't install if
  152. # TMINSTALLDIR isn't set.
  153. #
  154. #ifndef no_install
  155. #ifdef TMINSTALLDIR
  156. install            :: $(TM).md/$(NAME) installman MAKEINSTALL
  157. #else
  158. install            :: .SILENT
  159.     echo "Can't install $(NAME):  no install directory defined"
  160. #endif TMINSTALLDIR
  161. #endif no_install
  162.  
  163.  
  164. #if eg immediately after the boot program prints out the kernel sizes.)
  165. # BOOTDIR is the directory in which the boot things live.
  166. #
  167.  
  168. #if !empty(TM:Msun3)
  169. KERNELSTART    ?= 0x3fe0
  170. LINKSTART    ?= d4000
  171. #else
  172. #if !empty(TM:Msun4)
  173. KERNELSTART    ?= 0x4000
  174. LINKSTART    ?= $(KERNELSTART:S/0x/20/)
  175. #else
  176. #if !empty(TM:Mds3100)
  177. KERNELSTART    ?= 0x80010000
  178. LINKSTART    ?= $(KERNELSTART:S/0x//)
  179. #else
  180. #if !empty(TM:Msun4c)
  181. KERNELSTART    ?= 0x3fe0
  182. LINKSTART    ?= $(KERNELSTART:S/0x/20/)
  183. #else
  184. KERNELSTART    ?= 0x4000
  185. LINKSTART    ?= $(KERNELSTART:S/0x/b/)
  186. #endif
  187. #endif
  188. #endif
  189. #endif
  190.  
  191. CFLAGS        += -DBOOT_CODE=0x$(LINKSTART) \
  192.         -DKERNEL_START=$(KERNELSTART) -DBOOTDIR=\"$(INSTALLDIR)\" \
  193.         -DOPENPROMS -DSAIO_COMPAT -DBOOT_FILE=\"$(TM)\"
  194.  
  195.  
  196. #
  197. # The .INCLUDES variable already includes directories that should be
  198. # used by cc and other programs by default.  Remove them, just so that
  199. # the output looks cleaner.
  200.  
  201. CFLAGS        += $(.INCLUDES:S|^-I/sprite/lib/include$||g:S|^-I/sprite/lib/include/$(TM).md$||g)
  202.  
  203. #
  204. # Transformation rules: these have special features to place .o files
  205. # in md subdirectories, run preprocessor over .s files, etc.
  206. # There are no profile rules for boot programs because they aren't profiled.
  207. #
  208.  
  209. .c.o        :
  210.     $(RM) -f $(.TARGET)
  211.     $(CC) $(CFLAGS) -c $(.IMPSRC) -o $(.TARGET)
  212. .s.o    :
  213. #if empty(TM:Mds3100)
  214.     $(CPP) $(CFLAGS:M-[ID]*) -m$(TM) -D$(TM) -D_ASM $(.IMPSRC) > $(.PREFIX).pp
  215.     $(AS) -o $(.TARGET) $(AFLAGS) $(.PREFIX).pp
  216.     $(RM) -f $(.PREFIX).pp
  217. #else
  218.     $(RM) -f $(.TARGET)
  219.     $(AS) $(AFLAGS) $(.IMPSRC) -o $(.TARGET)
  220. #endif
  221.  
  222. #
  223. # The following targets are .USE rules for creating things.
  224. #
  225.  
  226. #
  227. # MAKEBOOT usage:
  228. #    <program> : <objects> <libraries> MAKEBOOT
  229. #
  230. # Similar to MAKECMD, except it doesn't create the version.[ho] files,
  231. # and the variable LINKSTART is used to define where the boot program
  232. # gets loaded.
  233. #
  234. MAKEBOOT    :  .USE -lc
  235.     rm -f $(.TARGET)
  236.     $(LD) -N -e start -T $(LINKSTART) $(CFLAGS:M-L*) $(LDFLAGS) \
  237.         -o $(.TARGET) $(.ALLSRC:N-lc:Nend.o) -lc $(.ALLSRC:Mend.o)
  238.  
  239. #
  240. # MAKEINSTALL usage:
  241. #    install :: <dependencies> MAKEINSTALL
  242. #
  243. # The program is installed in $(TMINSTALLDIR) and backed-up to
  244. # $(TMINSTALLDIR).old
  245. #
  246. #ifndef NOBACKUP
  247. BACKUP        = -b $(TMINSTALLDIR).old
  248. #ifdef BACKUPAGE
  249. BACKUP += -B $(BACKUPAGE)
  250. #endif
  251. #else
  252. BACKUP        =
  253. #endif  NOBACKUP
  254.  
  255. MAKEINSTALL    : .USE
  256.     ${RM} -f $(TMINSTALLDIR)/$(NAME)
  257.     ${INSTALL_PROG} $(TM).md/$(NAME) $(TMINSTALLDIR)/$(NAME)
  258.  
  259. #
  260. # MAKELINT usage:
  261. #    <fluff-file> : <sources to be linted> MAKELINT
  262. #
  263. # <fluff-file> is the place to store the output from the lint.
  264. #
  265. MAKELINT    : .USE
  266.     $(RM) -f $(.TARGET)
  267.     $(LINT) $(LINTFLAGS) $(CFLAGS:M-[ID]*) $(.ALLSRC) > $(.TARGET) 2>&1
  268.  
  269. #
  270. # MAKEDEPEND usage:
  271. #    <dependency-file> : <sources> MAKEDEPEND
  272. #
  273. # Generate dependency file suitable for inclusion in future makes.
  274.  
  275. MAKEDEPEND    : .USE
  276.     @$(TOUCH) $(DEPFILE)
  277.     $(MAKEDEPEND) $(CFLAGS:M-[ID]*) -m $(TM) -w60 -f $(DEPFILE) $(.ALLSRC)
  278.     @$(MV) -f $(DEPFILE) $(DEPFILE).tmp
  279.     @$(SED) -e '/^#/!s|^.|$(TM).md/&|' <$(DEPFILE).tmp > $(DEPFILE)
  280.     @$(RM) -f $(DEPFILE).tmp
  281.  
  282. #if !defined(no_targets) && defined(NAME)
  283. #
  284. # We should define the main targets (make, make install, etc.).  See the
  285. # mkmf man page for details on what these do.
  286. #
  287. LIBS            ?=
  288.  
  289. #
  290. # start.o must come first
  291. default            : $(TM).md/$(NAME)
  292. $(TM).md/$(NAME)    : $(TM).md/start.o $(OBJS:S/$(TM).md\/start.o//:S/makeBoot.o//) MAKEBOOT
  293.  
  294.  
  295. clean            :: .NOEXPORT tidy 
  296.     $(RM) -f $(TM).md/$(NAME) 
  297.  
  298. tidy            :: .NOEXPORT 
  299.     $(RM) -f $(CLEANOBJS) $(CLEANOBJS:M*.o:S/.o$/.po/g) \
  300.             y.tab.c lex.yy.c core \
  301.         $(TM).md/lint \
  302.         a.out *~ $(TM).md/*~ version.h gmon.out mon.out
  303.  
  304. DEPFILE = $(TM).md/dependencies.mk
  305.  
  306. depend            : $(DEPFILE)
  307. $(DEPFILE)        ! $(SRCS:M*.c) $(SRCS:M*.s) MAKEDEPEND
  308.  
  309.  
  310. #
  311. # For "install", a couple of tricks.  First, allow local.mk to disable
  312. # by setting no_install.  Second, use :: instead of : so that local.mk
  313. # can augment install with additional stuff.  Third, don't install if
  314. # TMINSTALLDIR isn't set.
  315. #
  316. #ifndef no_install
  317. #ifdef TMINSTALLDIR
  318. install            :: $(TM).md/$(NAME) installman MAKEINSTALL
  319. #else
  320. install            :: .SILENT
  321.     echo "Can't install $(NAME):  no install directory defined"
  322. #endif TMINSTALLDIR
  323. #endif no_insta╨áDæ2 û
  324.   ╨áDÿ
  325.   É Æ    ö
  326. û ÿ ?·┌`xƒ├@ü╟αüΦ%x:%x:%x:%x:%x:%x
  327. ¥π┐É≡'áDαáD╥ ╘  ╓  ╪  ┌  £#á╨  ╨#á\É Æ    ö
  328. û ÿ Ü
  329. ?·Γ`xƒ─@£áü╟αüΦ@(#)inet.c    1.12 88/02/08    Copyr 1986 Sun Micro      p $l$° ¿⌠¿ ╚
  330. å  ≤8 ¼
  331. å  ≤T ê
  332. å  ≤x ` Γ \Γ 0    å  ≤╨ t ╪ p╪ D    å  ⌠╝
  333. 8 ╘
  334. 4╘    Σ ╤    α╤    Ç »    |»    `
  335. å  ÷á    8 ì    4ì    
  336. å  ÷ⁿ0 ╓,╓  êê\å  °ñ─
  337. å  ∙<x ╓t╓$ ╓ ╓ÿ
  338. å  ·hH
  339. å  ·╕l    å  √ö°    å  ⁿ\    å  ⁿñ─
  340. å  ■<ÿ    å  ■h  ╓╓ⁿå   Φå   ` \Då   ╝¿╓.0;C└NU≡]`hnu≡z âαì
  341. ╨¢ú└»@╝
  342. @╞═╫gcc_compiled._sccsid_etherbroadcastaddr_myetheraddr_idprom_inet_init_bzero_revarp_ip_output_bcmp_bcopy_arp_ipcksum_ip_input_in_broadaddr_comarp_inet_print_ether_print_in_lnaof_ifnet_rawintrqhead     1.2;
  343. branch   ;
  344. access   ;
  345. symbols  ;
  346. locks    dlong:1.2; strict;
  347. comment  @ * @;
  348.  
  349.  
  350. 1.2
  351. date     89.06.16.08.30.31;  author brent;  state Exp;
  352. branches ;
  353. next     1.1;
  354.  
  355. 1.1
  356. date     89.06.02.11.10.59;  author brent;  state Exp;
  357. branches ;
  358. next     ;
  359.  
  360.  
  361. desc
  362. @Header file for sprite tftp boot program
  363. @
  364.  
  365.  
  366. 1.2
  367. log
  368. @Added machparam.h
  369. @
  370. text
  371. @/*-
  372.  * boot.h --
  373.  *     Header file for sprite tftp boot program
  374.  *
  375.  * Copyright (c) 1987 by the Regents of the University of California
  376.  *
  377.  * Permission to use, copy, modify, and distribute this
  378.  * software and its documentation for any purpose and without
  379.  * fee is hereby granted, provided that the above copyright
  380.  * notice appear in all copies.  The University of California
  381.  * makes no representations about the suitability of this
  382.  * software for any purpose.  It is provided "as is" without
  383.  * express or implied warranty.
  384.  *
  385.  *    "$Header$ SPRITE (Berkeley)"
  386.  */
  387. #ifndef _BOOT_H
  388. #define _BOOT_H
  389.  
  390. #include <machparam.h>
  391.  
  392. #ifndef ASM
  393. #include    "sunromvec.h"
  394. #endif /* ASM */
  395.  
  396. #define BOOT_START        (BOOT_CODE-KERNEL_START)
  397.  
  398. #define printf      (*romp->v_printf)
  399. #define printhex  (*romp->v_printhex)
  400.  
  401. #endif /* _BOOT_H */
  402. @
  403.  
  404.  
  405. 1.1
  406. log
  407. @Initial revision
  408. @
  409. text
  410. @d19 2
  411. @
  412. #
  413. # This Makefile is included by several other system Makefiles.  It
  414. # sets up variables that depend on the particular target machine
  415. # being compiled for, such as compiler flags.  One variable should
  416. # be defined before including this file:
  417. #
  418. # TM        Target machine for which code is to be generated (e.g.
  419. #        sun2, sun3, spur, etc.)
  420. #
  421. # This file will create a variable TMCFLAGS, which, when passed to CC,
  422. # will ensure that an object file is generated for machines of type TM.
  423. # It will also generate a variable TMAFLAGS, which will serve the
  424. # same purpose for the assembler.  Finally, it will set program names
  425. # like AS and LD to values appropriate for the machine type.
  426. #
  427. # The only flags that should be defined here are those that are required 
  428. # for successful compilation on that machine.  Optional flags such as
  429. # optimization should be defined in local modules.  
  430. #
  431. # $Header: /sprite/lib/pmake/RCS/tm.mk,v 1.44 90/12/11 14:18:13 kupfer Exp $
  432.  
  433. # Down at the bottom we elide ds3100 from $MACHINES.  For the error
  434. # messages below, though, we want to keep the ds3100 in $MACHINES.
  435. # So, we define a new variable for use in the error messages.
  436.  
  437. SUPPORTED_MACHINES    := $(MACHINES)
  438.  
  439. # What follows is a big long if/elif chain, keyed on TM, to set flags,
  440. # CC, etc.  Each top-level branch also verifies that TM is in
  441. # MACHINES.  It would be nice if we could do this in just one place,
  442. # but pmake doesn't like the construct "empty(MACHINES:M$(TM))".
  443.  
  444. #if !empty(TM:Msun3)
  445. TMCFLAGS        = -msun3 
  446. TMAFLAGS        = -m68020
  447. LDFLAGS            = -msun3
  448. #if empty(MACHINES:Msun3) && !make(newtm)
  449. .BEGIN:
  450.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  451.     @echo "supported machines ($(SUPPORTED_MACHINES))."
  452.     exit 1
  453. #endif
  454. #if !empty(MACHINE:Mds3100)
  455. CC                      = gcc
  456. AS                      = gas
  457. LD                      = gld
  458. #endif /* MACHINE:ds3100 */
  459. #if !empty(MACHINE:Mds5000)
  460. CC                      = gcc
  461. AS                      = gas
  462. LD                      = gld
  463. #endif /* MACHINE:ds5000 */
  464.  
  465. #elif !empty(TM:Mspur)
  466. TMCFLAGS        = -mspur -mlong-jumps -DLOCKREG 
  467. TMAFLAGS        =
  468. AS            = /sprite/cmds.$(MACHINE)/sas
  469. LD            = /sprite/cmds.$(MACHINE)/sld
  470. RANLIB            = /sprite/cmds.$(MACHINE)/sranlib
  471. XLD            = /sprite/cmds.$(MACHINE)/xld
  472. NOOPTIMIZATION        =
  473. LDFLAGS            = 
  474. #if empty(MACHINES:Mspur) && !make(newtm)
  475. .BEGIN:
  476.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  477.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  478.     exit 1
  479. #endif
  480.  
  481. #elif !empty(TM:Msun4)
  482. TMCFLAGS        = -msun4 -Dsprite -Dsun4
  483. TMAFLAGS        = -msparc
  484. LDFLAGS            = -msun4
  485. #if empty(MACHINES:Msun4) && !make(newtm)
  486. .BEGIN:
  487.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  488.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  489.     exit 1
  490. #endif
  491. #if !empty(MACHINE:Mds3100)
  492. CC                      = gcc
  493. AS                      = gas
  494. LD                      = gld
  495. #endif /* MACHINE:ds3100 */
  496. #if !empty(MACHINE:Mds5000)
  497. CC                      = gcc
  498. AS                      = gas
  499. LD                      = gld
  500. #endif /* MACHINE:ds5000 */
  501.  
  502. #elif !empty(TM:Mcleansun4)
  503. TMCFLAGS        = -msun4 -Dsprite -Dsun4 -DCLEAN -DCLEAN_LOCK
  504. TMAFLAGS        = -msparc
  505. LDFLAGS            = -msun4
  506. #if empty(MACHINES:Mcleansun4) && !make(newtm)
  507. .BEGIN:
  508.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  509.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  510.     exit 1
  511. #endif
  512. #if !empty(MACHINE:Mds3100)
  513. CC                      = gcc
  514. AS                      = gas
  515. LD                      = gld
  516. #endif /* MACHINE:ds3100 */
  517. #if !empty(MACHINE:Mds5000)
  518. CC                      = gcc
  519. AS                      = gas
  520. LD                      = gld
  521. #endif /* MACHINE:ds5000 */
  522.  
  523. #elif !empty(TM:Msun4c)
  524. TMCFLAGS        = -msun4 -Dsprite -Dsun4c -Usun4
  525. TMAFLAGS        = -msparc
  526. LDFLAGS            = -msun4
  527. #if empty(MACHINES:Msun4c) && !make(newtm)
  528. .BEGIN:
  529.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  530.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  531.     exit 1
  532. #endif
  533. #if !empty(MACHINE:Mds3100)
  534. CC                      = gcc
  535. AS                      = gas
  536. LD                      = gld
  537. #endif /* MACHINE:ds3100 */
  538. #if !empty(MACHINE:Mds5000)
  539. CC                      = gcc
  540. AS                      = gas
  541. LD                      = gld
  542. #endif /* MACHINE:ds5000 */
  543.  
  544. #elif !empty(TM:Mcleansun4c)
  545. TMCFLAGS        = -msun4 -Dsprite -Dsun4 -Dsun4c -DCLEAN -DCLEAN_LOCK
  546. TMAFLAGS        = -msparc
  547. LDFLAGS            = -msun4
  548. #if empty(MACHINES:Mcleansun4c) && !make(newtm)
  549. .BEGIN:
  550.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  551.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  552.     exit 1
  553. #endif
  554. #if !empty(MACHINE:Mds3100)
  555. CC                      = gcc
  556. AS                      = gas
  557. LD                      = gld
  558. #endif /* MACHINE:ds3100 */
  559. #if !empty(MACHINE:Mds5000)
  560. CC                      = gcc
  561. AS                      = gas
  562. LD                      = gld
  563. #endif /* MACHINE:ds5000 */
  564.  
  565. #elif !empty(TM:Mcleansun3) 
  566. TMCFLAGS        = -msun3 -Dsun3 -DCLEAN -DCLEAN_LOCK
  567. TMAFLAGS        = -m68020
  568. LDFLAGS            = 
  569. #if empty(MACHINES:Mcleansun3) && !make(newtm)
  570. .BEGIN:
  571.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  572.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  573.     exit 1
  574. #endif
  575.  
  576. #elif !empty(TM:Mcleands3100)
  577. TMCFLAGS    = -Dds3100 -Dsprite -DCLEAN -DCLEAN_LOCK -Uultrix
  578. TMAFLAGS    = -Dds3100 -Dsprite -Uultrix
  579. LDFLAGS        = -L/sprite/lib/ds3100.md
  580. #if empty(MACHINES:Mcleands3100) && !make(newtm)
  581. .BEGIN:
  582.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  583.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  584.     exit 1
  585. #endif
  586.  
  587. #elif !empty(TM:Mds3100)
  588. TMCFLAGS    = -Dds3100 -Dsprite -Uultrix
  589. TMAFLAGS    = -Dds3100 -Dsprite -Uultrix
  590. LDFLAGS        = -L/sprite/lib/ds3100.md
  591. #if empty(MACHINES:Mds3100) && !make(newtm)
  592. .BEGIN:
  593.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  594.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  595.     exit 1
  596. #endif
  597. #if !empty(CC:Mgcc)
  598. TMCFLAGS    += -Dmips -DLANGUAGE_C
  599. #endif
  600.  
  601. #elif !empty(TM:Mds5000)
  602. TMCFLAGS    = -Dds5000 -Dsprite -Uultrix
  603. TMAFLAGS    = -Dds5000 -Dsprite -Uultrix
  604. LDFLAGS        = -L/sprite/lib/ds5000.md
  605. #if empty(MACHINES:Mds5000) && !make(newtm)
  606. .BEGIN:
  607.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  608.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  609.     exit 1
  610. #endif
  611. #if !empty(CC:Mgcc)
  612. TMCFLAGS    += -Dmips -DLANGUAGE_C
  613. #endif
  614.  
  615. #elif !empty(TM:Msun4nw)
  616.  
  617. #    Sun4 compiled not to use save/restore register window instructions.
  618. TMCFLAGS        = -msun4 -Dsprite -Dsun4 -B/users/mendel/lib/$(MACHINE).md/ -mno-windows -DNOWINDOWS
  619. TMAFLAGS        = -msparc
  620. LDFLAGS            = -msun4
  621. #if empty(MACHINES:Msun4nw) && !make(newtm)
  622. .BEGIN:
  623.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  624.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  625.     exit 1
  626. #endif
  627.  
  628. #elif !empty(TM:Msymm)
  629. TMCFLAGS    = -msymm -Dsprite -Dsymm
  630. TMAFLAGS    = -msymm
  631. LDFLAGS        = -msymm
  632. #if empty(MACHINES:Msymm) && !make(newtm)
  633. .BEGIN:
  634.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  635.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  636.     exit 1
  637. #endif
  638. #if !empty(MACHINE:Mds3100)
  639. CC                      = gcc
  640. AS                      = gas
  641. LD                      = gld
  642. #endif /* MACHINE:ds3100 */
  643. #if !empty(MACHINE:Mds5000)
  644. CC                      = gcc
  645. AS                      = gas
  646. LD                      = gld
  647. #endif /* MACHINE:ds5000 */
  648.  
  649. #elif !empty(TM:Msym)
  650. TMCFLAGS    = -msym -Dsprite -Dsym
  651. TMAFLAGS    = -msym
  652. LDFLAGS        = -msym
  653. #if empty(MACHINES:Msym) && !make(newtm)
  654. .BEGIN:
  655.     @echo "Sorry, the target machine ($(TM)) isn't in the list of"
  656.     @echo "allowed machines ($(SUPPORTED_MACHINES))."
  657.     exit 1
  658. #endif
  659. #if !empty(MACHINE:Mds3100)
  660. CC                      = gcc
  661. AS                      = gas
  662. LD                      = gld
  663. #endif /* MACHINE:ds3100 */
  664. #if !empty(MACHINE:Mds5000)
  665. CC                      = gcc
  666. AS                      = gas
  667. LD                      = gld
  668. #endif /* MACHINE:ds5000 */
  669.  
  670. #else
  671.  
  672. # (some random TM)
  673.  
  674. TMCFLAGS        ?= -m$(TM)
  675. TMAFLAGS        ?= -m$(TM)
  676. #endif
  677.  
  678. # (End of big if/elif chain)
  679.  
  680. # The line below makes ds3100 and people's private "machines" invisible
  681. # under for purposes of commands like "make all":  you have to ask for
  682. # them explicitly with the TM= option.
  683.  
  684.  
  685. #ifdef MACHINES
  686. MACHINES    := $(MACHINES:Nfd:Njhh:Ncleansun4:Ncleansun4c:Ncleansun3:Ncleands3100:Nspur:Nsun4nw:Nsymm)
  687. #endif
  688.  
  689. #if !make(clean) && !/*    @(#)idprom.h 1.17 89/12/13 SMI    */
  690.  
  691. /*
  692.  * Copyright (c) 1986 by Sun Microsystems, Inc.
  693.  */
  694.  
  695. #ifndef _mon_idprom_h
  696. #define _mon_idprom_h
  697.  
  698. #ifndef LOCORE
  699. /*
  700.  * Structure declaration for ID prom in CPU and Ethernet boards
  701.  */
  702.  
  703. struct idprom {
  704.     unsigned char    id_format;    /* format identifier */
  705.     /* The following fields are valid only in format IDFORM_1. */
  706.     unsigned char    id_machine;    /* machine type */
  707.     unsigned char    id_ether[6];    /* ethernet address */
  708.     long        id_date;    /* date of manufacture */
  709.     unsigned    id_serial:24;    /* serial number */
  710.     unsigned char    id_xsum;    /* xor checksum */
  711.     unsigned char    id_undef[16];    /* undefined */
  712. };
  713. #endif LOCORE
  714.  
  715. #define IDFORM_1    1    /* Format number for first ID proms */
  716.  
  717. /*
  718.  * The machine type field assignments are constrained such that the
  719.  * IDM_ARCH_MASK bits define the CPU architecture and the remaining bits
  720.  * identify the individual implementation of that architecture.
  721.  */
  722. #define    IDM_ARCH_MASK    0xf0    /* mask for architecture bits */
  723. #define    IDM_ARCH_SUN2    0x00    /* arch value for Sun-2 */
  724. #define    IDM_ARCH_SUN3    0x10    /* arch value for Sun-3 */
  725. #define IDM_ARCH_SUN4   0x20    /* arch value for Sun-4 */
  726. #define IDM_ARCH_SUN3X    0x40    /* arch value for Sun-3x */
  727. #define    IDM_ARCH_SUN4C    0x50    /* arch value for Sun-4c */
  728.  
  729. /* 
  730.  * All possible values of the id_machine field (so far): 
  731.  */
  732. #define    IDM_SUN2_MULTI        1    /* Machine type for Multibus CPU brd */
  733. #define    IDM_SUN2_VME        2    /* Machine type for VME CPU board    */
  734. #define    IDM_SUN3_CARRERA    0x11    /* Carrera CPU    */
  735. #define    IDM_SUN3_M25        0x12    /* M25 CPU    */
  736. #define    IDM_SUN3_SIRIUS        0x13    /* Sirius CPU    */
  737. #define IDM_SUN3_PRISM        0x14    /* Prism CPU    */
  738. #define IDM_SUN3_F        0x17    /* Sun3F CPU    */
  739. #define IDM_SUN3_E        0x18    /* Sun3E CPU    */
  740. #define IDM_SUN4        0x21    /* Sparc CPU    */
  741. #define IDM_SUN4_COBRA        0x22    /* Cobra CPU    */
  742. #define IDM_SUN4_STINGRAY    0x23    /* Stingray CPU    */
  743. #define IDM_SUN4_SUNRAY        0x24    /* Sunray CPU   */
  744. #define IDM_SUN3X_PEGASUS    0x41    /* Pegasus CPU    */
  745. #define IDM_SUN3X_HYDRA         0x42    /* Hydra CPU    */
  746. #define IDM_SUN4C               0x51    /* Campus CPU   */
  747. #define IDM_SUN4C_60        0x51    /* Campus-1 CPU */
  748. #define IDM_SUN4C_40        0x52    /* Reserve some names */
  749. #define IDM_SUN4C_65        0x53    /* That we might do */
  750. #define IDM_SUN4C_20        0x54    /* It might be bigger */
  751. #define IDM_SUN4C_70        0x55    /* It might be smaller */
  752. #define IDM_SUN4C_30        0x56    /* It might be faster */
  753. #define IDM_SUN4C_50        0x57    /* It might be slower */
  754. #define IDM_SUN4C_75        0x58    /* It might cost more */
  755. #define IDM_SUN4C_80        0x59    /* It might cost less */
  756. #define IDM_SUN4C_10        0x5a    /* It might sell well */
  757. #define IDM_SUN4C_45        0x5b    /* And then it might not */
  758. #define IDM_SUN4C_05        0x5c    /* It might be pink */
  759. #define IDM_SUN4C_85        0x5d    /* It might be blue */
  760. #define IDM_SUN4C_32        0x5e    /* I certainly don't know */
  761. #define IDM_SUN4C_HIKE        0x5f    /* Do you? */
  762.  
  763. #endif /*!_mon_idprom_h*/
  764. !
  765. !    .seg    "data"
  766. !    .asciz    "@(#)getidprom.s 1.3 88/02/08"
  767. !    Copyright (c) 1986 by Sun Microsystems, Inc.
  768. !
  769.  
  770. IDPROMBASE=0xffd047d8        ! base address of idprom in CTL space
  771. IDPROMSIZE=0x20            ! size of idprom
  772.  
  773.     .align 4
  774.     .seg    "text"
  775. !
  776. ! getidprom(addr, size)
  777. !
  778. ! Read the ID prom.
  779. ! This is mapped from IDPROMBASE for IDPROMSIZE bytes in the
  780. ! ASI_CTL address space for byte access only.
  781.     .global _getidprom
  782. _getidprom:
  783.     set     IDPROMBASE, %g1
  784.     clr     %g2
  785. 1:
  786.     ldub   [%g1 + %g2], %g7 ! get id prom byte
  787.     add     %g2, 1, %g2        ! interlock
  788.     stb     %g7, [%o0]        ! put it out
  789.     cmp     %g2, %o1        ! done yet?
  790.     bne,a   1b
  791.     add     %o0, 1, %o0        ! delay slot
  792.     retl                ! leaf routine return
  793.     nop                ! delay slot
  794. lSet * geoPtr->blocksPerRotSet;
  795. d285 14
  796. a298 5
  797.     sectorNumber = geoPtr->sectorsPerTrack * geoPtr->numHeads * cylinder +
  798.           geoPtr->sectorsPerTrack * geoPtr->tracksPerRotSet *
  799.           rotationalSet +
  800.           geoPtr->blockOffset[blockNumber];
  801.     sectorNumber += (fragNumber % FS_FRAGMENTS_PER_BLOCK) * SECTORS_PER_FRAG;
  802. d302 1
  803. a302 1
  804. #endif SCSI_DISK_BOOT
  805. d328 1
  806. a328 1
  807.     register Dev_DiskAddr *diskAddrPtr;
  808. d330 1
  809. a330 1
  810.     register FsGeometry *geoPtr;
  811. d336 1
  812. a336 1
  813.     geoPtr         = (FsGeometry *)data;
  814. d355 4
  815. d360 2
  816. a361 1
  817.                 rotationalSet + geoPtr->blockOffset[blockNumber] +
  818. d363 1
  819. d368 1
  820. a368 1
  821. #endif XYLOGICS_BOOT
  822. d393 5
  823. a397 4
  824.     register int sector;    /* Sector number, counting from zero  */
  825.     register int numSectors;    /* Number of sectors per track */
  826.     register int numHeads;    /* Number of heads on the disk */
  827.     register Dev_DiskAddr *diskAddrPtr;
  828. d407 2
  829. a408 1
  830. #endif XYLOGICS_BOOT
  831. d413 4
  832. a416 1
  833.  * Fs_IsSunLabel --
  834. d418 2
  835. a419 2
  836.  *    Poke around in the input buffer and see if it looks like
  837.  *    a Sun format disk label.
  838. d422 1
  839. a422 1
  840.  *    TRUE or FALSE
  841. d425 1
  842. a425 1
  843.  *    None.
  844. d429 23
  845. a451 6
  846. #ifdef notdef
  847. Boolean
  848. Fs_IsSunLabel(buffer)
  849.     Address buffer;    /* Buffer containing zero'th sector */
  850. {
  851.     register Sun_DiskLabel *sunLabelPtr;
  852. d453 15
  853. a467 2
  854.     sunLabelPtr = (Sun_DiskLabel *)buffer;
  855.     if (sunLabelPtr->magic == SUN_DISK_MAGIC) {
  856. d469 1
  857. a469 1
  858.      * Should check checkSum...
  859. d471 4
  860. a474 4
  861.     return(TRUE);
  862.     } else {
  863.     Sys_Printf("Sun magic <%x>\n", sunLabelPtr->magic);
  864.     return(FALSE);
  865. d476 1
  866. a477 24
  867. #endif
  868.  
  869. /*
  870.  *----------------------------------------------------------------------
  871.  *
  872.  * Fs_IsSpriteLabel --
  873.  *
  874.  *    Poke around in the input buffer and see if it looks like
  875.  *    a Sprite format disk header.
  876.  *
  877.  * Results:
  878.  *    TRUE or FALSE
  879.  *
  880.  * Side effects:
  881.  *    None.
  882.  *
  883.  *----------------------------------------------------------------------
  884.  */
  885. #ifdef notdef
  886. Boolean
  887. Fs_IsSpriteLabel(buffer)
  888.     Address buffer;    /* Buffer containing zero'th sector */
  889. {
  890.     register FsDiskHeader *diskHeaderPtr;
  891. a478 11
  892.     diskHeaderPtr = (FsDiskHeader *)buffer;
  893.     if (diskHeaderPtr->magic == FS_DISK_MAGIC) {
  894.     return(TRUE);
  895.     } else {
  896. #ifndef NO_PRINTF
  897.     Sys_Printf("Sprite magic <%x>\n", diskHeaderPtr->magic);
  898. #endif
  899.     return(FALSE);
  900.     }
  901. }
  902. #endif
  903. @
  904.  
  905.  
  906. 1.7
  907. log
  908. @Wasn't calling the correct device type read routine.
  909. @
  910. text
  911. @d11 1
  912. a11 1
  913. static char rcsid[] = "$Header: fsDisk.c,v 1.6 87/05/19 12:14:44 brent Exp $ SPRITE (Berkeley)";
  914. a17 1
  915. #include "fsInt.h"
  916. a18 1
  917. #include "fsLocalDomain.h"
  918. d20 1
  919. a20 2
  920. #include "fsPrefix.h"
  921. #include "sunDiskLabel.h"
  922. @
  923.  
  924.  
  925. 1.6
  926. log
  927. @Added mapping routines for drivers that need head/sector/cylinder
  928. addresses.
  929. @
  930. text
  931. @d11 1
  932. a11 1
  933. static char rcsid[] = "$Header: fsDisk.c,v 1.5 87/05/11 11:18:18 brent Exp $ SPRITE (Berkeley)";
  934. d84 6
  935. d96 1
  936. a96 1
  937.     status = (*fsRawDeviceOpsTable[0].readWrite)(FS_READ,
  938. d112 1
  939. a112 1
  940.     Sys_Printf("No header <%x>\n", status);
  941. d121 1
  942. a121 1
  943.     status = (*fsRawDeviceOpsTable[0].readWrite)(FS_READ,
  944. @
  945.  
  946.  
  947. 1.5
  948. log
  949. @Final trimmed down version
  950. @
  951. text
  952. @d11 1
  953. a11 1
  954. static char rcsid[] = "$Header: fsDisk.c,v 1.4 87/05/08 17:45:18 brent Exp $ SPRITE (Berkeley)";
  955. d30 2
  956. d99 1
  957. a99 1
  958.     numHeaderSectors = FS_NUM_DOMAIN_SECTORS;
  959. d103 1
  960. a103 1
  961.     numHeaderSectors = ((FsDiskHeader *)fsLabelBuffer)->numDomainSectors;
  962. d106 1
  963. a106 1
  964.     Sys_Printf("No disk header <%x>\n", status);
  965. d114 1
  966. a114 1
  967.                         numHeaderSectors);
  968. d124 1
  969. a124 1
  970.     Sys_Printf("Bad disk magic <%x>\n", headerPtr->magic);
  971. d162 1
  972. d187 99
  973. @
  974.  
  975.  
  976. 1.4
  977. log
  978. @Updated to reflect changes in fs header files
  979. @
  980. text
  981. @d11 1
  982. a11 1
  983. static char rcsid[] = "$Header: fsDisk.c,v 1.3 86/07/24 11:35:31 brent Exp $ SPRITE (Berkeley)";
  984. a35 5
  985.  * Global variables used because there is only one domain during a boot.
  986.  */
  987. Address fsLabelBuffer;
  988.  
  989. /*
  990. d44 5
  991. a48 2
  992. FsDomain *fsDomainPtr;
  993. FsHandle *fsRootHandlePtr;
  994. a73 1
  995.     register  Address buffer;        /* Read buffer */
  996. a86 1
  997.     buffer = (Address)Mem_Alloc(DEV_BYTES_PER_SECTOR);
  998. d90 2
  999. a91 2
  1000.          buffer, 0, §orsRead);
  1001.     if (Fs_IsSunLabel(buffer)) {
  1002. d98 1
  1003. d100 3
  1004. a102 2
  1005.     headerSector = ((FsDiskHeader *)buffer)->domainSector;
  1006.     numHeaderSectors = ((FsDiskHeader *)buffer)->numDomainSectors;
  1007. a106 1
  1008.     fsLabelBuffer = buffer;
  1009. a119 1
  1010.     fsDomainPtr = (FsDomain *)Mem_Alloc(sizeof(FsDomain));
  1011. a135 1
  1012.     fsRootHandlePtr = (FsHandle *)Mem_Alloc(sizeof(FsHandle));
  1013. d201 1
  1014. d219 1
  1015. d237 1
  1016. d254 1
  1017. @
  1018.  
  1019.  
  1020. 1.3
  1021. log
  1022. @more trimming
  1023. @
  1024. text
  1025. @d11 1
  1026. a11 1
  1027. static char rcsid[] = "$Header: fsDisk.c,v 1.2 86/07/21 09:36:00 brent Exp $ SPRITE (Berkeley)";
  1028. d90 1
  1029. a90 1
  1030.     buffer = (Address)Mem_Alloc(BYTES_PER_SECTOR);
  1031. d114 1
  1032. a114 1
  1033.     headerPtr = (FsDomainHeader *)Mem_Alloc(BYTES_PER_SECTOR *
  1034. d164 1
  1035. a164 1
  1036. #define SECTORS_PER_FRAG    (FS_FRAGMENT_SIZE / BYTES_PER_SECTOR)
  1037. d168 1
  1038. a168 1
  1039.     register Fs_Geometry *geoPtr;
  1040. @
  1041.  
  1042.  
  1043. 1.2
  1044. log
  1045. @Scrunched the code down.  Solidified Fs_AttachDisk
  1046. @
  1047. text
  1048. @d11 1
  1049. a11 1
  1050. static char rcsid[] = "$Header: fsDisk.c,v 1.1 86/07/18 09:32:40 brent Exp $ SPRITE (Berkeley)";
  1051. d78 1
  1052. a78 1
  1053.     int numHeaderSectors;        /* Number of sectors in volume header */
  1054. d118 1
  1055. a118 1
  1056.          &numHeaderSectors);
  1057. d126 1
  1058. a126 1
  1059.     Sys_Printf("FsDiskAttach: Bad magic # <%x>\n", headerPtr->magic);
  1060. d250 1
  1061. d252 1
  1062. @
  1063.  
  1064.  
  1065. 1.1
  1066. log
  1067. @Initial revision
  1068. @
  1069. text
  1070. @d11 1
  1071. a11 1
  1072. static char rcsid[] = "$Header: fsDisk.c,v 1.10 86/07/09 14:08:53 brent Exp $ SPRITE (Berkeley)";
  1073. d25 1
  1074. d33 1
  1075. a33 2
  1076. static Boolean IsSunLabel();
  1077. static Boolean IsSpriteLabel();
  1078. d35 4
  1079. a38 1
  1080. static Fs_Device fsDevice;
  1081. d40 5
  1082. a44 1
  1083. FsDomain *fsDomainPtr;    /* Top level info for the boot domain */
  1084. d46 5
  1085. a50 1
  1086. FsHandle *fsDiskHandlePtr;
  1087. d57 3
  1088. a59 7
  1089.  *    Make a file handle for the raw disk we are booting from.
  1090.  *    This makes sure the disk is up, reads the volume header,
  1091.  *    and calls the initialization routine for the block I/O module
  1092.  *    of the disk's driver.  By the time this is called the device
  1093.  *    initialization routines have already been called from Dev_Config
  1094.  *    so the device driver knows how the disk is partitioned into
  1095.  *    volumes.
  1096. d70 1
  1097. a70 1
  1098. Fs_AttachDisk(ctlrNum, unitNum, partNum, handlePtrPtr)
  1099. a73 1
  1100.     FsHandle **handlePtrPtr;    /* Return, handle for raw disk */
  1101. d75 6
  1102. a80 8
  1103.     ReturnStatus status;    /* Error code */
  1104.     Address buffer;        /* Read buffer */
  1105.     int headerSector;        /* Starting sector of volume header */
  1106.     int numHeaderSectors;    /* Number of sectors in volume header */
  1107.     int sectorsRead;        /* Returned from read call */
  1108.     FsHandle    *handlePtr;    /* Reference to file handle for root */
  1109.     FsFileID    fileID;        /* ID for root directory of domain */
  1110.  
  1111. a84 1
  1112.     buffer = (Address)Mem_Alloc(BYTES_PER_SECTOR);
  1113. d86 3
  1114. a88 7
  1115.      * This dives right down to the device specific I/O routines in order
  1116.      * to read the special info kept at the beginning of the volume.
  1117.      * Once the volume header has been read the regular block I/O interface
  1118.      * to the device can be used.
  1119.      * Read the zero'th sector of the partition.  It has a copy of the
  1120.      * disk header, and that describes how the rest of the zero'th
  1121.      * cylinder is layed out.
  1122. d90 1
  1123. d93 3
  1124. a95 8
  1125.          fsDevice.unit, buffer, 0, §orsRead);
  1126.     if (status != SUCCESS) {
  1127.     return(status);
  1128.     }
  1129.     /*
  1130.      * Check for different disk formats.
  1131.      */
  1132.     if (IsSunLabel(buffer)) {
  1133. d102 3
  1134. a104 5
  1135.     } else if (IsSpriteLabel(buffer)) {
  1136.     register FsDiskHeader *diskHeaderPtr;
  1137.     diskHeaderPtr = (FsDiskHeader *)buffer;
  1138.     headerSector = diskHeaderPtr->domainSector;
  1139.     numHeaderSectors = diskHeaderPtr->numDomainSectors;
  1140. d106 1
  1141. a106 1
  1142.     Sys_Printf("No disk header\n");
  1143. d109 1
  1144. d111 2
  1145. a112 1
  1146.      * Read the volume header and save it with the domain.
  1147. d114 2
  1148. a115 1
  1149.     buffer = (Address)Mem_Alloc(BYTES_PER_SECTOR * numHeaderSectors);
  1150. d117 2
  1151. a118 1
  1152.          fsDevice.unit, buffer, headerSector, &numHeaderSectors);
  1153. d124 3
  1154. a126 4
  1155.     fsDomainPtr->headerPtr = (FsDomainHeader *)buffer;
  1156.     if (fsDomainPtr->headerPtr->magic != FS_DOMAIN_MAGIC) {
  1157.     Sys_Printf("FsDiskAttach: Bad magic # on volume header <%x>\n",
  1158.                   fsDomainPtr->headerPtr->magic);
  1159. d130 2
  1160. a131 5
  1161.      * Call the Block I/O initialization routine which sets up the
  1162.      * ClientData part of *devicePtr to reference the Fs_Geometry
  1163.      * part of the domain header.  Then overwrite the device
  1164.      * specification at was on the disk because the device unit depends on
  1165.      * the system configuration.
  1166. d133 9
  1167. a141 11
  1168.     (*fsBlockOpsTable[0].init)(&fsDevice, &fsDomainPtr->headerPtr->geometry);
  1169.     fsDomainPtr->headerPtr->device = fsDevice;
  1170.  
  1171.     fsDiskHandlePtr = (FsHandle *)Mem_Alloc(sizeof(FsHandle));
  1172.     fsDiskHandlePtr->fileID.serverID = -1;
  1173.     fsDiskHandlePtr->fileID.domain = 0;
  1174.     fsDiskHandlePtr->fileID.fileNumber = 0;
  1175.     fsDiskHandlePtr->fileID.version = -1;
  1176.     fsDiskHandlePtr->domainToken = (ClientData)fsDomainPtr;
  1177.  
  1178.     *handlePtrPtr = fsDiskHandlePtr;
  1179. d148 10
  1180. a157 1
  1181.  * IsSunLabel --
  1182. d159 36
  1183. d206 2
  1184. a207 2
  1185. static Boolean
  1186. IsSunLabel(buffer)
  1187. d219 1
  1188. d227 1
  1189. a227 1
  1190.  * IsSpriteLabel --
  1191. d240 2
  1192. a241 2
  1193. static Boolean
  1194. IsSpriteLabel(buffer)
  1195. a244 2
  1196.     register int index;
  1197.     register int checkSum;
  1198. d250 1
  1199. a252 45
  1200. }
  1201.  
  1202. /*
  1203.  *----------------------------------------------------------------------
  1204.  *
  1205.  * Fs_BlocksToSectors --
  1206.  *
  1207.  *    Convert from block indexes (actually, fragment indexes) to
  1208.  *    sectors using the geometry information on the disk.  This
  1209.  *    is a utility for block device drivers.
  1210.  *
  1211.  * Results:
  1212.  *    The sector number that corresponds to the fragment index.
  1213.  *    The caller has to make sure that its I/O doesn't cross a
  1214.  *    filesystem block boundary.
  1215.  *
  1216.  * Side effects:
  1217.  *    None.
  1218.  *
  1219.  *----------------------------------------------------------------------
  1220.  */
  1221. #define SECTORS_PER_FRAG    (FS_FRAGMENT_SIZE / BYTES_PER_SECTOR)
  1222. int
  1223. Fs_BlocksToSectors(fragNumber, geoPtr)
  1224.     int fragNumber;
  1225.     register Fs_Geometry *geoPtr;
  1226. {
  1227.     register int sectorNumber;    /* The sector corresponding to the fragment */
  1228.     register int cylinder;    /* The cylinder number of the fragment */
  1229.     register int rotationalSet;    /* The rotational set with cylinder of frag */
  1230.     register int blockNumber;    /* The block number within rotational set */
  1231.  
  1232.     blockNumber        = fragNumber / FS_FRAGMENTS_PER_BLOCK;
  1233.     cylinder        = blockNumber / geoPtr->blocksPerCylinder;
  1234.     blockNumber        -= cylinder * geoPtr->blocksPerCylinder;
  1235.     rotationalSet    = blockNumber / geoPtr->blocksPerRotSet;
  1236.     blockNumber        -= rotationalSet * geoPtr->blocksPerRotSet;
  1237.  
  1238.     sectorNumber = geoPtr->sectorsPerTrack * geoPtr->numHeads * cylinder +
  1239.           geoPtr->sectorsPerTrack * geoPtr->tracksPerRotSet *
  1240.           rotationalSet +
  1241.           geoPtr->blockOffset[blockNumber];
  1242.     sectorNumber += (fragNumber % FS_FRAGMENTS_PER_BLOCK) * SECTORS_PER_FRAG;
  1243.  
  1244.     return(sectorNumber);
  1245. @
  1246.